package com.tjw.ec.upms.api.feign.factory;

import com.tjw.ec.upms.api.feign.RemotePermitGroupService;
import com.tjw.ec.upms.api.feign.fallback.RemotePermitGroupServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


/**
 * 远程调用异常工厂 : 权限组表,将一模块的中的所有权限划分一个权限组中,可以通过权限组授予用户权限;
 *
 * @author T-junwen
 * @email t-junwen@foxmail.com
 * @date 2019-08-02 11:58:44
 */
@Slf4j
@Component
public class RemotePermitGroupServiceFallbackFactory implements FallbackFactory<RemotePermitGroupService> {

    @Override
    public RemotePermitGroupService create(Throwable throwable) {
        RemotePermitGroupServiceFallbackImpl remotePermitGroupServiceFallback = new RemotePermitGroupServiceFallbackImpl();
        remotePermitGroupServiceFallback.setCause(throwable);
        return remotePermitGroupServiceFallback;
    }
}

